package br.ufrj.dcc.smarthotel.listeners;

import java.util.Hashtable;

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import br.ufrj.dcc.smarthotel.activities.EventDetailActivity;
import br.ufrj.dcc.smarthotel.activities.ServicesMenuActivity;
import br.ufrj.dcc.smarthotel.entities.Service;

public class ServicesMenuClickListener implements OnItemClickListener {
	private ServicesMenuActivity activity;
	
	public ServicesMenuClickListener(ServicesMenuActivity activity) {
		this.activity = activity;
	}
	
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
		Service clickedService = this.activity.getServicesList().get(position);
		
		Hashtable<String, String> params = new Hashtable<String, String>();
		
		params.put("clickedServiceId", String.valueOf(clickedService.getServiceId()));
		
		this.activity.startActivity(EventDetailActivity.class, params, 1);
	}

}
